package com.example.musicplayer;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

public class SongDetailActivity extends AppCompatActivity {

    private TextView detailTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_song_detail);

        detailTextView = findViewById(R.id.song_detail);

        // 获取传递的数据
        Intent intent = getIntent();
        String title = intent.getStringExtra("title");
        String artist = intent.getStringExtra("artist");
        String album = intent.getStringExtra("album");
        String playlist = intent.getStringExtra("playlist");

        // 设置文本内容，使用换行符隔开
        String songDetails = "歌名：" + title + "\n" +
                "艺人：" + artist + "\n" +
                "专辑：" + album + "\n" +
                "歌单：" + playlist;
        detailTextView.setText(songDetails);
    }
}
